import { nextTick, onMounted, ref, Ref } from 'vue'

export function useTableHeight() {
  const maxTableHeight = ref(100)
  const tableWrapEl = ref(null) as Ref<HTMLElement>
  onMounted(async () => {
    await nextTick()
    maxTableHeight.value = tableWrapEl.value.offsetHeight
  })
  return {
    maxTableHeight,
    tableWrapEl,
  }
}
